package com.qianxunclub.chapter12;


import java.util.function.Function;

public class Main {

    public static void main(String[] args) {

        Main main = new Main();

        // 单个入参可以简单写
        main.test(Test::print);

        System.out.println("==================");
        // 多个入参
        main.test(a -> {
            Test.print("userName", "22");
            System.out.println("获取到了test方法返回结果：" + a);
            return "成功";
        });

    }

    public void test(Function<String, String> function) {
        String re = function.apply("aaa");
        System.out.println("获取到处理结果为：" + re);
    }

}
